package pers.course.exam;

class PrintMe implements Runnable {
    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {
            try {
                Thread.sleep(1000);
            }catch (InterruptedException ex) {
                ex.printStackTrace();
            }
            System.out.println("Thread: " + Thread.currentThread().getName());
        }
    }
}

public class TestThreeThreads {
    public static void main(String[] args) {
        PrintMe pm = new PrintMe();
        Thread t1 = new Thread(pm);
        t1.setName("Thread-1");
        Thread t2 = new Thread(pm);
        t2.setName("Thread-2");
        Thread t3 = new Thread(pm);
        t2.setName("Thread-3");
        t1.start();
        t2.start();
        t3.start();
    }
}
